<template>
	<div>
		
	</div>
</template>

<script>
import {
		loadFn,
		axiosPost,
		axiosGet,
		axiosDelete,
		axiosPut,
		AllLoading,
		axiosChange
	} from "@/common.js";
	export default{
		mounted(){
			loadFn()
			axiosPost('/user/redirect/',{},(res)=>{
				if(res.code == 0){
					AllLoading.close()
					localStorage.company_name = JSON.stringify({
						name: res.detail.company_name
					})
					localStorage.all_elevator_count = JSON.stringify({
						count: res.detail.elevator_count
					})
					localStorage.all_access_count = JSON.stringify({
						count: res.detail.access_count
					})
					localStorage.all_today_fault = JSON.stringify({
						count: res.detail.today_fault
					})
					localStorage.company_id = JSON.stringify({
						id: res.detail.company_id
					})
					localStorage.username = JSON.stringify({
						name: res.detail.username
					})
					localStorage.role = JSON.stringify({
						id: res.detail.role
					})
					localStorage.roleId = JSON.stringify({
						id: res.detail.id
					})
					localStorage.pt = JSON.stringify({
						list: res.detail.pt
					})
					if (res.detail.role == 0) {
						localStorage.tags = JSON.stringify({
							"list": [{
								"label": "平台概述",
								"isColor": 1,
								"pathIndex": "/MainView/Summarize"
							}]
						})
						this.$router.push({
							name: 'Summarize'
						})
					} else {
						localStorage.tags = JSON.stringify({
							"list": [{
								"label": "维保概述",
								"isColor": 1,
								"pathIndex": "/MainView/OldStatistics"
							}]
						})
						this.$router.push({
							name: 'OldStatistics'
						})
					}
				}else{
					this.$message.error(res.detail.result)
				}
			})
		}
	}
</script>

<style>
</style>
